const axios = require('axios')

const service = axios.create({
    baseURL: '/api'
})

service.interceptors.request.use(function (config) {
    let token = localStorage.getItem("token");
    // console.log(token)
    if (token) {
        config.headers.token = token;
    }
    return config;
}, function (error) {
    return Promise.reject(error);
});

export default service
